<template>
  <div style="width: 100%;">
    <el-table v-loading="loading" :data="roomNormList" >
      <el-table-column label="费用类型" align="left" prop="feeCondition.projectType" width="120"/>
      <el-table-column label="收费项目" align="left" prop="feeCondition.chargeName" width="180"/>
      <el-table-column label="收费标准" align="left" prop="feeCondition.normNames" width="180"/>
      <el-table-column label="开始收费时间" align="center" prop="beginChargeTime" width="180">
        <template slot-scope="scope">
          <el-date-picker
            v-model="scope.row.beginChargeTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择日期">
          </el-date-picker>
        </template>
      </el-table-column>
      <el-table-column label="结束收费时间" align="center" prop="finishChargetime" width="180">
        <template slot-scope="scope">
          <el-date-picker
            v-model="scope.row.finishChargetime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择日期">
          </el-date-picker>
        </template>
      </el-table-column>
      <el-table-column label="指定金额" align="center" prop="amountSpecified" width="160">
        <template slot-scope="scope">
          <el-input-number
            v-model="scope.row.amountSpecified"
            size="small"
            :precision="2"
            :step="0.1"
            :min="0"
            controls-position="right"
          />
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
    </el-table>

  </div>
</template>

<script>
  import {
    listRoomNorm,
    getRoomNorm,
    delRoomNorm,
    addRoomNorm,
    updateRoomNorm,
    exportRoomNorm
  } from "@/api/payfee/roomNorm";


  export default {
    name: "RoomNormList",
    data() {
      return {
        // 遮罩层
        loading: false,
        // 房屋收费标准表格数据
        roomNormList: [],
        // 查询参数
        queryParams: {
          projectId: null,
          chargeId: null,
          normId: null,
          nodeId: null
        },
      };
    },
    watch:{
      "roomId"(){
        this.getList()
      }
    },
    created() {
      this.getList()
    },
    methods: {
      /** 查询房屋收费标准列表 */
      getList() {
        this.loading = true;
        this.queryParams.roomId = this.roomId || -1
        listRoomNorm(this.queryParams).then(response => {
          this.roomNormList = response.rows;
          this.loading = false;
        });
      },
      getRoomNormList(){
        return this.roomNormList
      }
    },
    props: {
      roomId: {
        type: String,
        default: ""
      },
    }
  };
</script>
